package object_string_0920;

public class MyToString {
    private String name;
    private int age;

    public String getName() {
        return name;
    }

    public int getAge() {
        return age;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public MyToString(String name, int age) {
        this.name = name;
        this.age = age;
    }

    @Override
    public String toString() {

            return "name："+name+"age："+age;
    }

    public static void main(String[] args) {
        int a=7;
        int b=7;
        System.out.println(a==b);
        MyToString myToString=new MyToString("小熊软糖",18);
        MyToString myToString1=new MyToString("小熊软糖",18);
        System.out.println(myToString1==myToString);
//        System.out.println(myToString);
    }
}
